<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>我的订单</title>
<link rel="stylesheet" type="text/css" href="../css/aui.css">
<link rel="stylesheet" type="text/css" href="../css/aui-slide.css">
<link rel="stylesheet" type="text/css" href="../css/aui-flex.css">
<link rel="stylesheet" type="text/css" href="../css/my.css">
<link rel="stylesheet" type="text/css" href="../css/index.css">
<link rel="stylesheet" type="text/css" href="../css/common.css">
<style>
.aui-tab-item.aui-active {
    color: #f43948;
    border-bottom: 2px solid #f43948;
}
.aui-list-item-media img{width: 3rem;height: 3rem;}
</style>
</head>

<body>
<div class="bg_imgs jb">
  <div class="aui-tab aui-content-padded" id="tab" style=" background:none !important; padding:0 !important;margin-top: 0;">
        <div class="aui-tab-item aui-active text-white" tapmode="" data-item-order="0">淘宝  </div>
        <div class="aui-tab-item text-white" tapmode="" data-item-order="1">京东</div>
        <div class="aui-tab-item text-white" tapmode="" data-item-order="2">拼多多</div>
  </div>
  <div class="aui-title findorder hide" style="margin-bottom:-20px" >
    <div id="search">
        <div class="aui-searchbar-input aui-border-radius" style=" height:2rem !important; line-height:2rem !important;">
            <i class="aui-iconfont aui-icon-search"></i>
            <input type="search" placeholder="请输入订单号" id="search-input" disabled=""  style=" height:2rem !important; line-height:2rem !important;">
           <div class="aui-searchbar-cancel souso" tapmod>找回淘宝订单</div>
        </div>
    </div>
  </div>
</div>
<!-- 顶部end --> 
<!-- 热门搜索 -->
<div class="aui-tab" id="tab2" style=" margin-top:0rem;">
    <div class="aui-tab-item aui-active">全部订单</div>
    <div class="aui-tab-item">已付款</div>
    <div class="aui-tab-item">已结算</div>
    <div class="aui-tab-item">已失效</div>
</div>
<div class="aui-content" id="list">

  <!-- <div class="aui-card-list aui-margin-t-10 aui-margin-b-5">
    <div class="aui-card-list-header aui-card-list-user">
          <div class="aui-card-list-user-name">
              <small class="dedao">已付款</small>
          </div>
          <div class="aui-card-list-user-info">2018-10-20 14:20:20</div>
      </div>
      <div class="aui-media-list-item-inner aui-padded-10">
        <div class="aui-list-item-media">
            <img src="../image/pro01.jpg">
                        </div>
            <div class="tb_zt_right aui-margin-l-10">
                <div class="tb_zt_texttop">
                    <div class="tb_zt_text">
                        <div class="tb_zt_texticon"><img src="../image/taobao.png"></div>
                        <div class="tb_zt_texttit">【爆款返厂】冬春色羊毛圆领</div>
                    </div>
                </div>
                <div class="tb_zt_textbottom">
                    <div class="tb_numbar">
                        <div class="tb_price">¥59<span>¥136</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="aui-list-header aui-margin-l-10 aui-padded-b-10">
            <p>订单编号：412561126</p>
        </div>
  </div>

  <div class="aui-card-list aui-margin-t-10 aui-margin-b-5">
    <div class="aui-card-list-header aui-card-list-user">
          <div class="aui-card-list-user-name">
              <div>订单编号</div>
              <small class="dedao" style=" background:#ccc !important;">已失效</small>
        </div>
        <div class="aui-card-list-user-info">2018-10-20 14:20:20</div>
    </div>
    <div class="aui-media-list-item-inner aui-padded-10">
      <div class="aui-list-item-media">
          <img src="../image/pro01.jpg"></div>
          <div class="tb_zt_right aui-margin-l-10">
              <div class="tb_zt_texttop">
                  <div class="tb_zt_text">
                      <div class="tb_zt_texticon">淘宝</div>
                      <div class="tb_zt_texttit">【爆款返厂】冬春色羊毛圆领</div>
                  </div>
                  <div class="tb_zt_bq">
                      <span>预估赚¥8.88</span><span>升级赚¥8.88</span>
                  </div>
              </div>
              <div class="tb_zt_textbottom">
                  <div class="tb_numbar">
                      <div class="tb_price">¥59<span>¥136</span></div>
                      <div class="tb_yhq">100元优惠券</div>
                  </div>
              </div>
          </div>
      </div>
      <div class="aui-list-header aui-margin-l-10 aui-padded-b-10">
          <p>订单编号：412561126</p>
      </div>
  </div> -->

</div>

<!-- 固定底部end -->
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript" src="../script/doT.min.js" ></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript">
    var tjp = 't',status=1,p=0,is_fans=0;
    apiready = function(){
        api.parseTapmode();
        status = api.pageParam.other||1;
        if (status==9) {
          status = 1;
          is_fans = 1;
        }
        //流动监听
        api.addEventListener({
            name:'scrolltobottom',
            extra:{
                threshold:100 //设置距离底部多少距离时触发，默认值为0，数字类型
            }
        }, function(ret, err){
            getData();
        });
        //淘京拼切换
        var tab = new auiTab({
            element:document.getElementById("tab"),
        },function(ret){
          p=0;
          var tjp_arr = {"1":"t","2":"j","3":"p"}
          tjp = tjp_arr[ret.index];
          //找回订单
          /*if (tjp=='t') {
            $('.findorder').show();
            $('#tab2').css('margin-top','1.6rem');
          }else{
            $('.findorder').hide();
            $('#tab2').css('margin-top','0');
          }*/
          getData();
        });
        //订单状态切换
        var tab2 = new auiTab({
            element:document.getElementById("tab2"),
            index:status
        },function(ret){
          p=0;
          status = ret.index;
          getData();
        });
        
        getData();
    }
    function getData(){
        p++;//alert(tjp+'---'+status+'---'+p);return false;
        _loading2();
        _Ajax(window.APIServer.Order,'post',{values:{tjp:tjp,type:status,p:p,is_fans:is_fans}},'json',function(ret){
            _loading2_close();
            //.渲染页面
            if (ret.code==1) {
                var evalText = doT.template($api.text($api.byId('goodslist')));
                if (p==1) {
                    $api.html($api.byId('list'), evalText(ret));
                }else{
                    $api.append($api.byId('list'), evalText(ret));
                }
               imageCache('.goods_img');
            }else{
                p--;
                if (p==0) {
                  $('#list').html('')
                }
                $('.loading-1').remove();
                $('body').append('<div class="loading-1">'+ret.msg+'</div>');
            }
            
        })
    }
</script>
<script id="goodslist" type="text/x-dot-template">
    {{ for (key in it.data){ }}
    <div class="aui-card-list aui-margin-t-10 aui-margin-b-5" onclick='open_goods({{= JSON.stringify(it['data'][key]) }})' tapmode>
      <div class="aui-card-list-header aui-card-list-user">
            <div class="aui-card-list-user-name">
                <small class="dedao" {{? it['data'][key]['order_status']==3 }}style="background:#ccc !important;"{{?}}>{{= it['data'][key]['order_status_text'] }}</small>
            </div>
            <div class="aui-card-list-user-info">{{= it['data'][key]['create_time'] }}</div>
        </div>
        <div class="aui-media-list-item-inner aui-padded-10">
            <div class="aui-list-item-media">
              {{? it['data'][key]['pic']!='' }}
              <img src="../image/faleimg.gif" _src="{{= it['data'][key]['pic'] }}" class="goods_img">
              {{??}}
              <img src="../image/faleimg.gif" >
              {{?}}
            </div>
              <div class="tb_zt_right aui-margin-l-10">
                  <div class="tb_zt_texttop">
                      <div class="tb_zt_text">
                          <div class="tb_zt_texticon"><img src="../image/{{? it['data'][key]['order_type']==0 }}taobao{{?? it['data'][key]['order_type']==1 }}tmall{{?? it['data'][key]['order_type']==2 }}jd{{?? it['data'][key]['order_type']==3 }}pinduoduo{{?}}.png"></div>
                          <div class="tb_zt_texttit">{{= it['data'][key]['title'] }}</div>
                      </div>
                  </div>
                  <div class="tb_zt_textbottom">
                      <div class="tb_numbar">
                          <div class="tb_price">¥{{= it['data'][key]['pay_price'] }}<span>¥{{= it['data'][key]['price'] }}</span></div>
                      </div>
                  </div>
              </div>
          </div>
          <div class="aui-list-header aui-margin-l-10 aui-padded-b-10">
              <p>订单编号：{{= it['data'][key]['trade_id'] }}</p>
          </div>
    </div>
    {{ } }}
</script>
</html>
